var sourcesite = function() {

	//private properties
	var emptyFunction = function() {};

	// public properties
	return {
		sitename: "notset",
		stockname: "notset",
		locale: null,
		getName: emptyFunction,
		getLatest: emptyFunction,
		getOpen: emptyFunction,
		getChange: emptyFunction,
		getLow: emptyFunction,
		getHigh: emptyFunction,
		getVol: emptyFunction,
		getBuy: emptyFunction,
		getSell: emptyFunction,
		createParams: emptyFunction,

		/**
		 * gets stock statistics in a hash, retrived from html parse.
		 *
		 * @param responseText is XMLHttpRequest.responseText
		 *
		 * @return Hash, a map of CurVal (current value of share),
		 * Open (opened value), Low (lowest value of day), High
		 * (highest value of day), Vol (transaction volume) values.
		 */
		getStock: function(responseText) {
			return {
				Name: this.getName(responseText),
				Latest: this.getLatest(responseText),
				Open: this.getOpen(responseText),
				Change: this.getChange(responseText),
				Low: this.getLow(responseText),
				High: this.getHigh(responseText),
				Vol: this.getVol(responseText),
				Buy: this.getBuy(responseText),
				Sell: this.getSell(responseText)
			};
		},

		/**
		 * gets extra statistics that can be retrieved from sourcesite
		 * (such as exchange values). sourcesite adaptor must have a
		 * "extras" attribute for this function to be called. every
		 * entry of this extras list must have a "parse" function that
		 * will parse the response of the request done to url
		 * determined by "url" attribute of entry. parse function have
		 * to return a hash with two attributes: "value" and "tooltip"
		 * that will be used as xul button label and tooltip. see a
		 * concrete sample in a sourcesite adaptor to understand it
		 * better.
		 *
		 * @param responseText is XMLHttpRequest.responseText
		 *
		 * @return Hash, with attributes "value", and "tooltip", these
		 * will be used as xul button label and tooltip in interface.
		 */
		getExtra: function(extrakey, responseText) {
			return this.extras[extrakey].parse(responseText);
		}
	}
}()
